package com.candoit.webapps.pricing.model.opcional;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "opcional_fondeado")
public class Fondeado extends Opcional {

	@Column(name = "consumo_kg")
	private Double consumoKg;
	
	@Column(name = "precio_kg")
	private Double precioKg;
	
	public Double getConsumoKg() {
		return consumoKg;
	}

	public void setConsumoKg(Double consumoKg) {
		this.consumoKg = consumoKg;
	}

	public Double getPrecioKg() {
		return precioKg;
	}

	public void setPrecioKg(Double precioKg) {
		this.precioKg = precioKg;
	}

	@Override
	public Double getCosto() {
		Double consumoKg = getConsumoKg();
		Double precioKg = getPrecioKg();
		Double costo = consumoKg * precioKg / 10000;
		return costo;
	}

	@Override
	public String toString(){
		return super.toString() +" - "+ this.consumoKg + " Kg - $ " + this.precioKg;
	}
}
